package com.maimao.api.mall.info;

import com.maimao.core.model.resp.Result;
import com.maimao.model.info.Coupon;
import com.maimao.model.info.MgCoupon;
import com.maimao.model.info.SearchHistory;
import com.maimao.model.info.input.ConfirmCoupon;
import com.maimao.model.info.input.UseCouponInput;
import com.maimao.model.info.vo.CouponSearch;
import com.maimao.model.order.confirm.CouponSimple;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * @author MaoLin Wang
 * @date 2020/12/29 9:29 下午
 */
@Api(value = "优惠券管理")
@RequestMapping("/info/coupon")
public interface CouponApi {

    @ApiOperation("当前登录用户的店铺优惠券列表")
    Result<?> webShopCouponData(CouponSearch couponSearch, Integer page, Integer size);

    @ApiOperation("发行优惠券")
    Result<?> addCoupon(MgCoupon coupon, BindingResult bindingResult);

    @ApiOperation("修改优惠券")
    Result<?> updateCoupon(MgCoupon coupon, BindingResult bindingResult);

    @ApiOperation("领取优惠券")
    Result<?> take(Map<String, String> data);

    @ApiOperation("停止使用优惠券")
    public Result<?> deleteCoupon(Map<String, Object> data);

    @ApiOperation("当前用户是否领取对应的优惠券")
    Result<?> couponUserExist(List<Long> couponIds, Long userId);

    @ApiOperation("店铺的所有可用优惠券(店铺优惠券和商品优惠券)")
    Result<?> queryCouponsByShop(Long shopId);

    @ApiOperation("领取并查询店铺可用优惠券")
    Result<?> takeAndQueryShopUsefulShopCoupon(ConfirmCoupon confirmCoupon);

    @ApiOperation("领取并查询系统可用优惠券")
    Result<?> takeAndQuerySysUsefulShopCoupon(ConfirmCoupon confirmCoupon);

    @ApiOperation("下单时修改用户优惠券使用状态")
    Result<?> useCoupon(UseCouponInput useCouponInput);
}
